package com.itheima.mq;


import com.itheima.service.OrderService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class DlxConsumer {

    @Resource
    private OrderService orderService;

    //接受死信队列orderId,根据订单ID查询数据库订单状态
    @RabbitListener(queues = "dlx_queue")
    public void reciver(long orderId) {
        System.out.println("接收发送时间:" + System.currentTimeMillis());
        orderService.dealOrderByPayStatus(orderId);
    }
}
